|
|
9.3 | Inter-VLAN Routing Overview | ||
| 9.3.6 | Configuring inter-VLAN routing |
|
This section demonstrates the commands
necessary to configure inter-VLAN routing between a router and a switch.
Before any of these commands are implemented, each router and switch
should be checked to see which VLAN encapsulations they support.
Catalyst 2950 switches have supported 802.1q trunking since the release
of Cisco IOS release 12.0(5.2)WC(1), but they do not support
Inter-Switch Link (ISL) trunking. In order for inter-VLAN routing to
work properly, all of the routers and switches involved must support the
same encapsulation.
On a router, an interface can be logically divided into multiple, virtual subinterfaces. Subinterfaces provide a flexible solution for routing multiple data streams through a single physical interface. To define subinterfaces on a physical interface, perform the following tasks:
To identify the interface, use the interface command in global configuration mode.
The
port-number
identifies the physical interface, and the
subinterface-number
identifies the virtual interface.
The router must be able to talk to the switch using a standardized trunking protocol. This means that both devices that are connected together must understand each other. In the example, 802.1q is used. To define the VLAN encapsulation, enter the encapsulation command in interface configuration mode.
The vlan-number identifies the VLAN for which the subinterface will carry traffic. A VLAN ID is added to the frame only when the frame is destined for a nonlocal network. Each VLAN packet carries the VLAN ID within the packet header. To assign the IP address to the interface, enter the following command in interface configuration mode.
The
ip-address
and
subnet-mask
are the 32-bit network address and mask of the specific interface.
In the example, the router has three subinterfaces configured on Fast Ethernet interface 0/0. These three interfaces are identified as 0/0.1, 0/0.2, and 0/0.3. All interfaces are encapsulated for ISL. Interface 0/0.1 is routing packets for VLAN 1, whereas interface 0/0.2 is routing packets for VLAN 20 and 0/0.3 is routing packets for VLAN 30.
|